import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router);

export default new Router({
	routes: [{
		path: '/',
		redirect: '/login'
	}, {
		path: '/login',
		component: resolve => require(['@/components/login/login.vue'], resolve)
	}, {
		path: '/enum',
		component: resolve => require(['@/components/enum/enum.vue'], resolve)
	}, {
		path: '/main',
		name: 'main',
		component: resolve => require(['@/components/main/main.vue'], resolve),
		children: [{
				path: '/main/welcome',
				component: resolve => require(['@/components/main/welcome.vue'], resolve),
				meta: {
					title: '欢迎回来'
				}
			},
			{
				path: '/main/tab2',
				component: resolve => require(['@/components/main/tab2.vue'], resolve)
			},
			{
				path: '/main/menu',
				component: resolve => require(['@/components/systemSetting/menuSetting.vue'], resolve)
			},
			{
				path: '/main/user',
				component: resolve => require(['@/components/user/user.vue'], resolve)
			},
			{
				path: '/main/enum',
				component: resolve => require(['@/components/enum/enum.vue'], resolve)
			}, {
				path: '/main/permission',
				component: resolve => require(['@/components/permissionSetting/permissionSetting.vue'], resolve)
			}, {
				path: '/main/role',
				component: resolve => require(['@/components/role/role.vue'], resolve)
			}, {
				path: '/main/userInfo',
				component: resolve => require(['@/components/userInfo/userInfo.vue'], resolve)
			}, {
				path: '/main/quillEditor',
				component: resolve => require(['@/components/modules/quillEditor/quillEditor.vue'], resolve)
			}, {
				path: '/main/quillEditorList',
				component: resolve => require(['@/components/modules/quillEditor/quillEditorList.vue'], resolve)
			}, {
				path: '/main/UEditor',
				component: resolve => require(['@/components/modules/quillEditor/UEditor.vue'], resolve)
			}   //,
			//          {path:'*',component:resolve=>require(['@/page/404.vue'],resolve)}
		]
	}]
})